Add declarative custom-engine frontmatter and migrate Crush/OpenCode to shared behavior definitions#44465
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot remove crush/opencode from Go code and only keep them as shared agentic workflow files. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot create a new instruction file to help with configuring new agentic engines |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot merge main and recompile |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…c-engine-syntax Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
/smoke-opencode |
|
|
|
Run: https://github.com/github/gh-aw/actions/runs/29286484887
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
…c-engine-syntax Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
…xy provider The custom `awf-proxy` provider used a placeholder API key `awf-copilot-proxy` that only works when requests are routed through the AWF api-proxy container at 172.30.0.30:10002. However, `host.docker.internal:10002` resolves to the Docker host's LLM gateway (not the api-proxy container), which requires a real Copilot token and rejects the placeholder with HTTP 503. Fix: remove the custom `awf-proxy` provider from opencode.jsonc and remove the `model-env-provider-prefix: awf-proxy` rewrite. OpenCode's built-in `copilot` provider with `GITHUB_COPILOT_BASE_URL` and `OPENAI_API_KEY` env vars (already injected by universal-llm-consumer) works correctly against host.docker.internal:10002. Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Fixed in commit Root cause of HTTP 503: The OpenCode engine config defined a custom "awf-proxy": {
"api": "http://host.docker.internal:10002/v1",
"options": { "apiKey": "awf-copilot-proxy" },
"models": { "gpt-5.5": {} }
}This placeholder is designed to be replaced by the AWF api-proxy container ( Fix:
Local validation: Needs a maintainer |
|
Run: https://github.com/github/gh-aw/actions/runs/29300559914
|
|
/smoke-opencode |
|
🚀 Smoke OpenCode MISSION COMPLETE! OpenCode delivered. 🔥 |
Actions taken: none — working tree is clean, all previous fixes are in place. Hand-off: A maintainer needs to |
|
@copilot OpenCode is misconfigured https://github.com/github/gh-aw/actions/runs/29301322952/job/86985617751#step:28:1 |
…er with internal IP Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…172.30.0.30:10002)
OpenCode v1.2.14 uses @ai-sdk/openai@3.x for built-in providers (copilot, openai),
which always routes to the OpenAI Responses API (/v1/responses). The AWF proxy only
supports /v1/chat/completions, so every request fails with HTTP 503.
The fix is to use a custom provider name ("awf-proxy") which causes OpenCode to fall
back to @ai-sdk/openai-compatible, which ONLY uses Chat Completions API.
Previous fix (c5f4d10) used http://host.docker.internal:10002 as the api URL, but
from inside the AWF container this resolves to the Docker host machine's LLM gateway
which requires a real Copilot token and rejects the placeholder key.
Correct fix: use http://172.30.0.30:10002/v1 (constants.AWFAPIProxyContainerIP) which
is the internal Docker network address of the AWF api-proxy sidecar. This endpoint
accepts the awf-copilot-proxy placeholder key because the proxy handles token steering
internally.
Also adds 172.30.0.30 and 172.30.0.30:PORT entries to AWFNoProxyHosts so that Bun
(which backs OpenCode) bypasses Squid when making requests to the internal api-proxy.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in commit Root cause: OpenCode v1.2.14 uses Why the previous fix ( Actual fix (restored approach with correct IP):
A maintainer |
|
/smoke-opencode |
|
🚀 Smoke OpenCode MISSION COMPLETE! OpenCode delivered. 🔥 |
|
@copilot error with connection https://github.com/github/gh-aw/actions/runs/29303183562/job/86991186603#step:28:1 |
…ions Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…int is /chat/completions not /v1/chat/completions) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in commit Root cause: The AWF api-proxy sidecar at port 10002 serves the Copilot API format, which uses Fix: Changed to Please |
|
/smoke-opencode |
|
🚀 Smoke OpenCode MISSION COMPLETE! OpenCode delivered. 🔥 |
|
@copilot pick an older model compatible with completions https://github.com/github/gh-aw/actions/runs/29313009110/job/87020905713#step:28:1 |
…atibility Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Switched to Fixed in commit |
This introduces a richer engine-definition frontmatter shape for shared/custom agentic engines and uses it to move Crush and OpenCode off bespoke Go implementations onto a common declarative runtime path. The new syntax is expressive enough for CLI-style engines that need install, config, execution, MCP, capability, and auth wiring, including Auggie-like cases.
New engine-definition surface
engine.experimental,engine.auth, andengine.behaviorsto the named engine definition form.behaviorscaptures the runtime contract instead of hard-coding it in Go:authprovides explicit secret bindings for engines that need engine-specific credentials forwarded into the runtime.Shared behavior-defined runtime
BehaviorDefinedEnginethat materializes aCodingAgentEnginefrom frontmatter.Crush/OpenCode refactor
pkg/workflow/data/engines/crush.mdpkg/workflow/data/engines/opencode.mdSchema and docs
Coverage
Example of the new shared engine definition shape: